package com.tomecode.tools.maven.settings.model;

import com.tomecode.tools.maven.settings.SettingsFactory;
import com.tomecode.tools.maven.settings.model.xml.XmlElement;

/**
 * 
 * The conditional logic which will automatically trigger the inclusion of this
 * profile.
 * 
 * @author Frastia Tomas
 * 
 */
public final class Activation extends XmlElement {
	/**
	 * Flag specifying whether this profile is active as a default.
	 */
	private String activeByDefault;
	/**
	 * Specifies that this profile will be activated when a matching JDK is
	 * detected.
	 */
	private String jdk;
	/**
	 * Specifies that this profile will be activated when matching OS attributes
	 * are detected.
	 */
	private Os os;
	/**
	 * Specifies that this profile will be activated based on existence of a
	 * file.
	 */
	private File file;
	/**
	 * Specifies that this profile will be activated when this System property
	 * is specified.
	 */
	private Property property;

	public Activation() {

	}

	public final String getActiveByDefault() {
		return activeByDefault;
	}

	public final boolean isActiveByDefault() {
		return Boolean.parseBoolean(activeByDefault);
	}

	public final void setActiveByDefault(String activeByDefault) {
		this.activeByDefault = activeByDefault;
		if (SettingsFactory.isEmpty(activeByDefault)) {
			setDeleted(activeByDefault);
		}

	}

	public final String getJdk() {
		return jdk;
	}

	public final void setJdk(String jdk) {
		this.jdk = jdk;
	}

	public final File getFile() {
		return file;
	}

	public final void setFile(File file) {
		this.file = file;
	}

	public final Os getOs() {
		return os;
	}

	public final void setOs(Os os) {
		this.os = os;
	}

	public final Property getProperty() {
		return property;
	}

	public final void setProperty(Property property) {
		this.property = property;
	}

}
